<include file="__THEME__/header" />
<link href="../Public/css/photo.css" rel="stylesheet" type="text/css" />
<script>
function sharePop(id,url,type){
	var classId = '#BtnShare_'+id;
	$(classId).attr('disabled','true');

	$.post(url+"/addShare_check/", {aimId:id,type:type}, function(txt){
		   if(txt==1){
			   ymPrompt.win(url+'/addShare/aimId/'+id+'/type/'+type,500,'315','分享',null,null,null,{id:'a'});
		   }else if(txt==-1){
			   ymPrompt.errorInfo('请不要分享自己发布的东西!');
		   }else if(txt==-2){
			   ymPrompt.errorInfo('您已经分享过,请不要重复分享!');
		   }else if(txt==-3){
			   ymPrompt.errorInfo('您没有权限分享!');
		   }else{
			   ymPrompt.errorInfo('参数出错,请重试!');
		   }
		   
		   $(classId).attr('disabled','');
	});
}
</script>
<!-- 头部 end -->
<div class="content"><!-- 内容 begin  -->
	<include file="__THEME__/apps" />
	<div class="main"> <!-- 右侧内容 begin  -->

	<div class="page_title"><!-- page_title begin -->
		<div class="left" style="width:70px;">
			<span class="headpic50"><a href="__TS__/space/{$user.id}"><img src="{$user.id|getUserFace}" /></a></span>
		</div>
		<div class="left" style="width:650px;">
			<h2>{$user.name}的专辑“{$album.name}”</h2>
			<p><a href="__TS__/space/{$user.id}">{$user.name}的空间</a> ┊ <a href="__TS__/Notify/write/uid/{$user.id}">发站内信</a></p>
		</div>
		<div class="left alR lh30" style="width:100px;"><a href="javascript:window.history.back(-1)">返回上一页</a></div>
	<div class="c"></div>
</div><!-- page_title end -->
  
	<!-- 切换标签 end  -->
	<div class="MenuSub">
		<span class="right">
			<eq name="album.share" value="1"><php>if(isAddApp('share')) { </php>
			<input type="button" value="分享" class="BtnShare" onclick="sharePop('{$album.id}','__URL__','album')" id="BtnShare_{$album.id}"/>
			<php> } </php></eq>
		</span>
		共{$album.photoCount}张 ┊ 
		<if condition="$album['userId'] eq $mid">
		<a href="__APP__/Upload/flash/albumId/{$album.id}">添加新照片</a> ┊ 
        <a href="__APP__/Index/albums/uid/{$user.id}">返回我的专辑</a> ┊  
		<span id="more_operation" style="display:none;">
		<a href="__APP__/Manage/album_edit/id/{$album.id}">编辑该专辑</a> ┊  
		<a href="javascript:del_album()">删除该专辑</a>
        <!--
		 ┊ 
		<a href="__APP__/Manage/album_order/id/{$album.id}">照片排序</a> ┊ 
		<a href="javascript:add_to_group({$album.id})">复制到群相册</a>
        -->
        </span>
		<a href="#" onclick="$('#more_operation').show(); $(this).remove()">更多操作</a>
		<else />
        <a href="__APP__/Index/albums/uid/{$user.id}">返回{$user.name}的专辑</a>
        </if>
	</div>
  
	<div class="photoBox">
    <ul class="piclist">
	<eq name="photos.data" value="">
		<div style="padding:20px">
			该专辑还没有照片
			<if condition=" $mid eq $album['userId'] ">，<a href="__APP__/Upload/flash/albumId/{$album.id}">开始添加新照片</a></if>
		</div>
	</eq>
    <volist name="photos.data" id="li">
        <li>
        <a href="__APP__/Index/photo/id/{$li.id}/aid/{$album.id}/uid/{$li.userId}" class="preview" rel="__ROOT__/thumb.php?w=400&h=400&t=f&url={$li.savepath|get_photo_url}" title="{$li.name}"><img src="__ROOT__/thumb.php?w=120&h=100&t=f&url={$li.savepath|get_photo_url}" /><br />{$li.name|getShort='10'}</a></li>
    </volist>
    </ul>
	<!-- photoBox end  -->
  	</div>
  <div class="lh30"><span class="right cGray2">{:date('Y年m月d日',$album['cTime'])}创建</span><!-- 该专辑里有：<a href="#">赵杰</a>, xx  --></div>
  <div class="page">{$photos.html}</div>  </div><!-- 右侧内容 end  -->
  <div class="c"></div>
</div><!-- 内容 end -->
<include file="__THEME__/footer" />
<script src="../Public/js/preview.js" type="text/javascript"></script>
<script type="text/javascript">
//删除相册
function del_album(){
	ymPrompt.confirmInfo({message:'删除相册同时会删除所有照片，你确定要删除这个相册么？',handler:ajax_delete_album});
}
function ajax_delete_album(e){
	var album_id	=	'{$album.id}'; 
	if(e=='ok'){
		$.post(APP+'/Manage/delete_album',{ajax:1,id:album_id},function(data){
			if(data==1){
				//设置数据
				parent.location.href = APP+'/Index/albums/uid/{$mid}';
			}else{
				ymPrompt.close();
				ymPrompt.errorInfo('删除失败！');
			}
		});
	}else{
		ymPrompt.close();
	}
	return false;
}
</script>